package com.sakura.test;

import com.sakura.config.MainConfigOfLifeCycle;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author Sakura
 * @Date 2023-02-22 16:47
 */
public class IOCTestOfLifeCycle {

    @Test
    public void testInitAndDestroyOfBean(){
        AnnotationConfigApplicationContext configApplicationContext
                = new AnnotationConfigApplicationContext(MainConfigOfLifeCycle.class);

        System.out.println("容器创建完成.....");

        //获取对象
//        configApplicationContext.getBean("cat");

        configApplicationContext.close();
    }
}
